<?php

namespace app\admin\model;

use think\Model;


class OrderRefunds extends Model
{

    

    

    // 表名
    protected $name = 'order_refunds';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    public function getStatus(){
        return [
            'SUCCESS'=>'退款成功',
            'CLOSED'=>'退款关闭',
            'PROCESSING'=>'退款处理中',
            'ABNORMAL'=>'退款异常',
        ];
    }


    //获取退款编号
    public static function getOrderNo(){
        $order_no = 'TK'.date("YmdHis") . mt_rand(100000, 999999);
        $find = Order::where(['order_no'=>$order_no])->find();
        if($find){
            self::getOrderNo();
        }else{
            return $order_no;
        }
    }






}
